package util;

public class MyPosition {
    private int x;
    private int y;
    private int width;
    private int height;

    public MyPosition(int x, int y, int width, int height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }

    public MyPosition(MyPosition myPosition) {
        setPosition(myPosition);
    }

    public boolean equals(MyPosition myPosition) {
        boolean is_true = true;
        if (x != myPosition.getX())
            is_true = false;
        else if (y != myPosition.getY())
            is_true = false;
        else if (width != myPosition.getWidth())
            is_true = false;
        else if (height != myPosition.getHeight())
            is_true = false;

        return is_true;
    }

    // set&get
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void setPosition(MyPosition myPosition) {
        x = myPosition.x;
        y = myPosition.y;
        width = myPosition.width;
        height = myPosition.height;
    }

    @Override
    public String toString() {
        return "MyPosition [height=" + height + ", width=" + width + ", x=" + x + ", y=" + y + "]";
    }

}
